﻿#include <iostream>
using namespace std;
int main()
{
    //常量指针，不能通过解引用的方法修改内存地址中的值（用原始变量名可以修改）
    //int a = 3, b = 8;
    //const int* p = &a;
    ////*p = 10;
    //a = 10;
    //cout << "a=" << a << ",*p=" << *p << endl;
    //p = &b;
    //cout << "b=" << b << ",*p=" << *p << endl;

    //指针常量
    int a = 3, b = 8;
    int* const p = &a;
    *p = 10;
    cout << "a=" << a << ",*p=" << *p << endl;
}
